Shoes.app(:width => 600, :height => 400) do
  bus = stack do
    strokewidth(2)
    stroke(rgb(0, 0, 0))
    fill(rgb(255, 255, 255))
    rect(:top => 2, :left => 2, :width => 150, :height => 50, :curve => 3)
    
    strokewidth(0)
    fill(rgb(0, 0, 0))
    rect(:top => 6 , :left => 8, :width => 20, :height => 44)

    fill(rgb(0, 0, 0))
    rect(:top => 6 , :left => 32, :width => 116, :height => 18)

    oval(:top => 48, :left => 40, :radius => 10, :center => true)
    oval(:top => 48, :left => 124, :radius => 10, :center => true)
  end

  do_move = true
  click do
    do_move = !do_move
  end
  
  motion do |left, top|
    if do_move
      bus.move(left, top)
    end
  end
end
